<div>
    <czy-toolbar>
        <czy-toolbar-item>
            <span slot="label">名称</span>
            <span slot="item"><el-input v-model="queryParam.like.name"></el-input></span>
        </czy-toolbar-item>
        <czy-toolbar-btn>
            <el-button-group>
                <el-button type="primary" icon="search" size="small" @click="search">查询</el-button>
                <el-button type="primary" icon="plus" size="small" @click="toAdd">新增</el-button>
            </el-button-group>
        </czy-toolbar-btn>
    </czy-toolbar>

    <el-table :data="pageData" border stripe highlight-current-row>
        <el-table-column prop="name" label="名称"></el-table-column>
        <el-table-column prop="sex" label="性别"></el-table-column>
        <el-table-column prop="sysDept.name" label="部门"></el-table-column>
        <el-table-column prop="email" label="邮箱"></el-table-column>
        <el-table-column prop="telephone" label="电话"></el-table-column>
        <el-table-column label="操作" width="200">
            <template scope="scope">
                <el-tooltip content="修改" placement="top" effect="light" :enterable="false">
                    <el-button size="mini" type="warning" icon="edit" @click="toEdit(scope.row)"></el-button>
                </el-tooltip>
                <el-tooltip content="删除" placement="top" effect="light" :enterable="false">
                    <el-button size="mini" type="danger" icon="delete"
                               @click="del(scope.row)"></el-button>
                </el-tooltip>
                <el-tooltip content="设置角色" placement="top" effect="light" :enterable="false">
                    <el-button size="mini" type="warning" @click="setRole(scope.row)">
                        <i class="fa fa-user-o"></i>
                    </el-button>
                </el-tooltip>
            </template>
        </el-table-column>
    </el-table>

    <el-pagination layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="sizeChange"
                   @current-change="turnPage" :page-size="pageSize" :current-page="currentPage"></el-pagination>

    <edit @save-success="search" ref="edit" ></edit>
    <role @role-save="search" ref="role"></role>
</div>